package lesson.myicharstream;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class CharStreamDemo3 {
    public static void main(String[] args) throws IOException {
        //1.实现键盘录入
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名");
        String name = sc.next();
        System.out.println("请输入密码");
        String password = sc.next();

        FileWriter fw = new FileWriter("Day12\\src\\lesson\\myicharstream\\c.txt");
        fw.write(name);
        fw.write("\r\n");
        fw.write(password);

        fw.flush();
        fw.close();
    }
}
